﻿using System;
using System.Data;
using System.Text;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TaxEntity.House;
using TaxEntity.User;
using TaxBiz.House;
using TaxBiz.User;
using TaxBiz.Tax;
using TaxBiz.SysConfig;
using BaseData.UI;
using BaseData.Common;

namespace Admin.Zonghe
{
    public partial class QueryDetail : BaseCommon.BasePage
    {
        protected string id = string.Empty;
        protected DataTable dtDepartmet = null;
        protected DataTable dtDiduan = null;
        protected DataTable dtManager = null;
        protected DataTable dtTaxComplete = null;
        protected HouseInfoBiz hib = new HouseInfoBiz();
        protected HouseInfoEntity hie = new HouseInfoEntity();
        protected string rentId = string.Empty;
        protected RentInfoBiz rib = new RentInfoBiz();
        protected RentInfoEntity rie = new RentInfoEntity();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!HasPower())
            {
                Jscript.AlertAndGoBack("您权限不足，不能操作");
                return;
            }
            id = PageContext.GetRequest("id");
            if (string.IsNullOrEmpty(id))
            {
                Jscript.AlertAndGoBack("参数错误");
                return;
            }
            long iId = 0;
            long.TryParse(id, out iId);
            if (iId <= 0)
            {
                Jscript.AlertAndGoBack("参数错误");
                return;
            }
            hie = hib.GetEntityById(iId);
            if (hie == null)
            {
                Jscript.AlertAndGoBack("参数错误");
                return;
            }
            dtDepartmet = new DepartmentBiz().GetList();
            dtDiduan = new DiDuanBiz().GetList();
            dtManager = new UserBiz().GetList(hie.DepartmentID);
            dtTaxComplete = new TaxCompleteBiz().GetList(hie.CertificateID);
            this.rptDataList.DataSource = dtTaxComplete;
            this.rptDataList.DataBind();

            rentId = PageContext.GetRequest("rentid");
            long iRentId = 0;
            long.TryParse(rentId, out iRentId);
            if (iRentId > 0)
            {
                rie = rib.GetEntityById(iRentId);
                if (rie == null)
                {
                    Jscript.AlertAndGoBack("参数错误");
                    return;
                }
            }
        }
    }
}